From: John Paul Wallington Date: Sat, 10 Jan 2004 01:19:53 +0000 (+0000) Subject: (mode-line-change-eol): Add EVENT parameter. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~24525 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=ec89e9460bd7e761dcce270296c46c8a0d71b8e1;p=emacs.git (mode-line-change-eol): Add EVENT parameter. Temporarily select EVENT's window for changing eol type. --- diff --git a/lisp/bindings.el b/lisp/bindings.el index ed4da745b2d..1f86f3b6fcb 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -135,12 +135,14 @@ corresponding to the mode line clicked." "Local keymap for the coding-system part of the mode line.") -(defun mode-line-change-eol () +(defun mode-line-change-eol (event) "Cycle through the various possible kinds of end-of-line styles." - (interactive) - (let ((eol (coding-system-eol-type buffer-file-coding-system))) - (set-buffer-file-coding-system - (cond ((eq eol 0) 'dos) ((eq eol 1) 'mac) (t 'unix))))) + (interactive "e") + (save-selected-window + (select-window (posn-window (event-start event))) + (let ((eol (coding-system-eol-type buffer-file-coding-system))) + (set-buffer-file-coding-system + (cond ((eq eol 0) 'dos) ((eq eol 1) 'mac) (t 'unix)))))) (defvar mode-line-eol-desc-cache nil)